#pragma once

#include <string>
#include <map>

/**
    Constant Strings
    Convention:
        _S_ = string to be placed
        _I_ = int
        _F_ = decimal value

    Ex.
        StrConst strCnst;
        ...
        Print( strCnt[ FILE_NOT_FOUND_S_ ], "myFileName.txt" );
        Print( strCnt[ ERROR_ON_LINE_I_ ], 50 );
*/
const std::string StrMsg [] = 
{
    /**
        Common Errors
    */
    "UNKNOWN",
    "FILE_NOT_FOUND_S_",
    "ERROR_LOADING_S_" ,  
    "ERROR_INIT_S_"    ,   
    "ERROR_ON_LINE_I_" ,  
    "FATAL_INIT_S_"    ,  
    "FATAL_LOADING_S_"  ,  
    "NOT_ENOUGH_MEM_S_" , 
    "PARSE_ERROR_S_"    ,  
    "_S_WRITE_PROTECTED", 
    
    
    "_S_INIT",
    "LOADING_S_",
    "SAVING_S_",

    /**
        Commands Usage
    */
    "RUN_F",
    "EXEC_F",
    "BIND_F",
    "UNBIND_F"

};
/**
================================
String Constants to be read from a file
================================
*/
class StrConst
{
public:
    StrConst(void);

    /** Load Strings */
    void LoadStrings( const std::string &file );
    
    /** Access a String */
    std::string operator[]( const std::string &msg ) {
        if ( HasMsg( msg ) )
            return m_Strings[msg];
        return m_Strings[ "UNKNOWN" ];
    };

    /** Test to see if there is this msg */
    bool HasMsg( const std::string &msg ) {
        return m_Strings.find( msg ) != m_Strings.end();
    }

private:
    typedef std::map< std::string, std::string > type_Strings;
    type_Strings    m_Strings;
public:
    virtual ~StrConst(void);
};
